<template>
  <div>

    <div>
      <el-form :inline="true" :model="studentForm" :rules="rules" ref="studentForm" class="demo-form-inline">
      <el-form-item label="学生" prop="studentInfo">
        <el-input v-model="studentForm.studentInfo" placeholder="学生信息"  @change="changeModel()"></el-input>
      </el-form-item>
      <el-form-item label="查询类型" prop="select">
        <el-select v-model="studentForm.select" placeholder="选择查询类型"  @change="changeModel()">
          <el-option label="学生ID" value="1"></el-option>
          <el-option label="学生姓名" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm('studentForm')">查询</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click.native="addDetail(false)">添加学生</el-button>
      </el-form-item>
      </el-form>
    </div>

    <el-table
      ref="multipleTable"
      :data="tableData.list"
      tooltip-effect="dark"
      style="width: 100%"
      @selection-change="handleSelectionChange">
      <el-table-column
        type="selection">
      </el-table-column>
      <el-table-column
        prop="studentId"
        label="学号">
      </el-table-column>
      <el-table-column
        prop="studentName"
        label="姓名">
      </el-table-column>
      <el-table-column
        prop="studentSex"
        label="性别">
      </el-table-column>
      <el-table-column
        prop="major.majorName"
        label="所在专业">
      </el-table-column>
      <el-table-column
        prop="studentEducation"
        label="学历">
      </el-table-column>
      <el-table-column
        prop="studentName"
        label="课程进度">
      </el-table-column>
      <el-table-column
        prop="major.majorId"
        label="班级">
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
         <el-button
           type="primary" icon="el-icon-edit" size="small"
              @click.native="showDetail(scope.row.studentId,0)">
         </el-button>
         <el-button
           type="primary" icon="el-icon-info" size="small"
             @click.native="showDetail(scope.row.studentId,1)">
         </el-button>
         <el-button
           type="primary" icon="el-icon-delete" size="small"
           @click="StudentDel(scope.row.studentId)">
         </el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage3"
        :page-size="pageSize"
        layout="total,prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>


   <el-dialog title="学生详情" :visible.sync="dialogFormVisible">
     <div style="margin: 10px;"></div>
        <el-form :label-position="labelPosition" label-width="100px" :model="gridData" :rules="rules3" ref="gridData">
            <el-form-item label="姓名:" prop="studentName">
              <el-input v-model="gridData.studentName"  :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="邮箱:" prop="studentEmail">
             <el-input v-model="gridData.studentEmail" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="性别:" prop="studentSex">
             <el-input v-model="gridData.studentSex" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="民族:" prop="studentNation">
             <el-input v-model="gridData.studentNation" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="学号:" prop="studentId">
             <el-input v-model="gridData.studentId" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="身份证:" prop="studentIdcard">
              <el-input v-model="gridData.studentIdcard" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="毕业院校:" prop="studentGraduate">
              <el-input v-model="gridData.studentGraduate" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <!-- <el-form-item label="出生日期:">
             <el-input v-model="gridData.studentBirth" :disabled="gridData.isShow"></el-input>
            </el-form-item> -->
            <el-form-item label="出生日期:" prop="studentBirth">
              <el-date-picker type="date" placeholder="选择日期" v-model="gridData.studentBirth" :disabled="gridData.isShow" style="width: 100%;"></el-date-picker>
            </el-form-item>
            <el-form-item label="家庭住址:" prop="studentAddress">
              <el-input v-model="gridData.studentAddress" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="学历:" prop="studentEducation">
              <el-input v-model="gridData.studentEducation" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="手机号:" prop="studentPhone">
             <el-input v-model="gridData.studentPhone" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="所选专业:" prop="major.majorName">
             <el-input v-model="gridData.major.majorName" :disabled="gridData.isShow"></el-input>
            </el-form-item>
            <el-form-item label="缴费金额:" prop="studentSecondMoney">
             <el-input v-model="gridData.studentSecondMoney" :disabled="gridData.isShow"></el-input>
            </el-form-item>
         </el-form>
      <!-- <div slot="footer" class="dialog-footer" model="gridData">
           <el-button type="primary" v-model="gridData.isShow" @click="submitFormUp('gridData')">确 定</el-button>
      </div> -->
    </el-dialog>

    <el-dialog title="修改学生" :visible.sync="dialogFormVisible1">
      <div style="margin: 10px;"></div>
         <el-form :label-position="labelPosition" label-width="100px" :model="gridUpData" :rules="rules3" ref="gridUpData">
             <el-form-item label="姓名:" prop="studentName">
               <el-input v-model="gridUpData.studentName"  :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="性别:" prop="studentSex">
              <el-input v-model="gridUpData.studentSex" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="邮箱:" prop="studentEmail">
              <el-input v-model="gridUpData.studentEmail" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="民族:" prop="studentNation">
              <el-input v-model="gridUpData.studentNation" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="学号:" prop="studentId">
              <el-input v-model="gridUpData.studentId" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="身份证:" prop="studentIdcard">
               <el-input v-model="gridUpData.studentIdcard" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="毕业院校:" prop="studentGraduate">
               <el-input v-model="gridUpData.studentGraduate" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <!-- <el-form-item label="出生日期:">
              <el-input v-model="gridData.studentBirth" :disabled="gridData.isShow"></el-input>
             </el-form-item> -->
             <el-form-item label="出生日期:" prop="studentBirth">
               <el-date-picker type="date" placeholder="选择日期" v-model="gridUpData.studentBirth" :disabled="gridUpData.isShow" style="width: 100%;"></el-date-picker>
             </el-form-item>
             <el-form-item label="家庭住址:" prop="studentAddress">
               <el-input v-model="gridUpData.studentAddress" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="学历:" prop="studentEducation">
               <el-input v-model="gridUpData.studentEducation" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="手机号:" prop="studentPhone">
              <el-input v-model="gridUpData.studentPhone" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
             <!-- <el-form-item label="所选专业:" prop="major.majorName">
              <el-input v-model="gridUpData.major.majorName" :disabled="gridUpData.isShow"></el-input>
             </el-form-item> -->
             <el-form-item label="所选专业" prop="major.majorName" width =100%>
               <el-select v-model="gridUpData.majorId" placeholder="gridUpData.majorName">
                 <el-option v-for="major in majorAll" :key="major.majorId" :label="major.majorName" :value="major.majorId">
                 <span>{{ major.majorName }}</span>
                 <!-- <span style="float: right; color: #8492a6; font-size: 13px">{{ major.majorId }}</span> -->
                 </el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="缴费金额:" prop="studentSecondMoney">
              <el-input v-model="gridUpData.studentSecondMoney" :disabled="gridUpData.isShow"></el-input>
             </el-form-item>
          </el-form>
       <div slot="footer" class="dialog-footer" model="gridUpData">
            <el-button type="primary" v-model="gridUpData.isShow" @click="submitFormUp('gridUpData')">确 定</el-button>
       </div>
     </el-dialog>

    <el-dialog title="添加学生" :visible.sync="dialogFormVisiblee">
      <div style="margin: 10px;"></div>
         <el-form :label-position="labelPosition" label-width="100px" :model="gridAddData" :rules="rules2" ref="gridAddData">
           <el-row>
            <el-col :span="12">
              <div>
               <el-form-item label="姓名:" prop="studentName">
                 <el-input v-model="gridAddData.studentName"  :disabled="gridAddData.isShow"></el-input>
               </el-form-item>
               <el-form-item label="性别:" prop="studentSex">
                <!-- <el-input v-model="gridAddData.studentSex" :disabled="gridAddData.isShow"></el-input> -->
                <el-radio v-model="gridAddData.studentSex" label="男">男</el-radio>
                <el-radio v-model="gridAddData.studentSex" label="女">女</el-radio>
               </el-form-item>
               <el-form-item label="邮箱:" prop="studentEmail">
                <el-input v-model="gridAddData.studentEmail" :disabled="gridAddData.isShow"></el-input>
               </el-form-item>
               <el-form-item label="民族:" prop="studentNation">
                <el-input v-model="gridAddData.studentNation" :disabled="gridAddData.isShow"></el-input>
               </el-form-item>
               <el-form-item label="身份证:" prop="studentIdcard">
                <el-input v-model="gridAddData.studentIdcard" :disabled="gridAddData.isShow"></el-input>
               </el-form-item>
             </div>
            </el-col>
            <el-col :span="12">
              <div>
                <el-form-item label="学生照片:" prop="studentPhoto">
                  <el-upload
                    class="avatar-uploader" action="/api/admin/uploadStuPhoto/"
                    :show-file-list="false"
                    :on-success="handleAvatarSuccess"
                    :on-remove="handleRemove"
                    :before-upload="beforeAvatarUpload">
                    <img v-if="imageUrl" :src="imageUrl" class="avatar">
                    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                  </el-upload>
                  <span style="font-size:12px">上传头像图片只能是 JPG 格式，且不超过2MB</span>
                  <!-- <el-input v-model="gridAddData.studentIdcard" :disabled="gridAddData.isShow"></el-input> -->
                </el-form-item>
              </div>
            </el-col>
          </el-row>
             <el-form-item label="毕业院校:" prop="studentGraduate">
               <el-input v-model="gridAddData.studentGraduate" :disabled="gridAddData.isShow"></el-input>
             </el-form-item>
               <el-form-item label="出生日期:" prop="studentBirth">
                 <el-date-picker type="date" placeholder="选择日期" v-model="gridAddData.studentBirth" :disabled="gridAddData.isShow" style="width: 100%;"></el-date-picker>
               </el-form-item>
             <el-form-item label="家庭住址:" prop="studentAddress">
               <el-input v-model="gridAddData.studentAddress" :disabled="gridAddData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="学历:" prop="studentEducation">
               <el-input v-model="gridAddData.studentEducation" :disabled="gridAddData.isShow"></el-input>
             </el-form-item>
             <el-form-item label="手机号:" prop="studentPhone">
              <el-input v-model="gridAddData.studentPhone" :disabled="gridAddData.isShow"></el-input>
             </el-form-item>
             <!-- <el-form-item label="所选专业:" prop="majorName">
              <el-input v-model="gridAddData.majorName" :disabled="gridAddData.isShow"></el-input>
             </el-form-item> -->
             <el-form-item label="所选专业" prop="majorId" width =100%>
               <el-select v-model="gridAddData.majorId" placeholder="请选择专业" size="200px">
                 <el-option v-for="major in majorAll" :key="major.majorId" :label="major.majorName" :value="major.majorId">
                 <span>{{ major.majorName }}</span>
                 <!-- <span style="float: right; color: #8492a6; font-size: 13px">{{ major.majorId }}</span> -->
                 </el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="缴费金额:" prop="studentSecondMoney">
              <el-input v-model="gridAddData.studentSecondMoney" :disabled="gridAddData.isShow"></el-input>
             </el-form-item>
             <el-form-item>
               <el-button type="primary" @click="submitFormAdd('gridAddData')">提交</el-button>
               <el-button @click="resetForm('gridAddData')">重置</el-button>
             </el-form-item>
          </el-form>
       <!-- <div slot="footer" class="dialog-footer" model="gridAddData">
            <el-button type="primary" v-model="gridAddData.isShow" @click="submitFormAdd('gridAddData')">确 定</el-button>
            <el-button @click="resetForm('gridAddData')">重置</el-button>
       </div> -->
     </el-dialog>


  </div>
</template>

<style>
  .el-row {
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .el-col {
    border-radius: 4px;
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 200px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 200px;
    display: block;
  }
</style>

<script>

  import {formatDate} from '@/common/js/date'
  import {StudentmanageFy,StudentmanageDel,StudentmanageSel,StudentmanageUp,StudentmanageAdd,majormanageAll} from '@/axios/api'
    export default {
      data() {
        return {
          tableData: {},
          total:1,
          pageSize:1,
          pageIndex:1,
          multipleSelection: [],
          currentPage3: 1,
          gridData: {
            isShow:true,
            major:{}
          },
          gridUpData:{
            isShow:true,
            major:{}
          },
          majorAll:[],
          gridAddData:{
            isShow:true,
            studentPhoto:'',
          },
          studentForm: {
            studentId: '',
            studentName: '',
            studentInfo: '',
            select: ''
          },
          labelPosition: 'right',
          dialogFormVisible: false,
          dialogFormVisiblee: false,
          dialogFormVisible1: false,
          imageUrl: '',
          rules: {
           select: [
             { required: true, message: '请选择查询区域', trigger: 'change' }
           ]
         },
         rules2: {
           studentName: [
             { required: true, message: '请输入学生姓名', trigger: 'blur' }
           ],
           studentEmail: [
             { required: true, message: '请输入邮箱', trigger: 'blur' }
           ],
           studentSex: [
             { required: true, message: '请输入学生性别', trigger: 'blur' }
           ],
           studentNation: [
             { required: true, message: '请输入学生民族', trigger: 'blur' }
           ],
           studentIdcard: [
             { required: true, message: '请输入身份证号', trigger: 'change' }
           ],
           studentGraduate: [
             { required: true, message: '请输入毕业院校', trigger: 'blur' }
           ],
          studentBirth: [
             { required: true, message: '请选择出生日期', trigger: 'blur' }
           ],
           studentAddress: [
             { required: true, message: '请输入家庭住址', trigger: 'blur' }
           ],
           studentEducation: [
             { required: true, message: '请输入学生学历', trigger: 'blur' }
           ],
           studentPhone: [
             { required: true, message: '请输入联系方式', trigger: 'blur' }
           ],
           majorId: [
             { required: true, message: '请选择专业名称', trigger: 'blur' }
           ],
           studentSecondMoney: [
             { required: true, message: '请输入缴费金额', trigger: 'blur' }
           ],
         },
         rules3: {
           studentName: [
             { required: true, message: '请输入学生姓名', trigger: 'blur' }
           ],
           studentEmail: [
             { required: true, message: '请输入邮箱', trigger: 'blur' }
           ],
           studentSex: [
             { required: true, message: '请输入学生性别', trigger: 'blur' }
           ],
           studentNation: [
             { required: true, message: '请输入学生民族', trigger: 'blur' }
           ],
           studentId: [
             { required: true, message: '请输入学生学号', trigger: 'change' }
           ],
           studentIdcard: [
             { required: true, message: '请输入身份证号', trigger: 'change' }
           ],
           studentGraduate: [
             { required: true, message: '请输入毕业院校', trigger: 'blur' }
           ],
          studentBirth: [
             { required: true, message: '请选择出生日期', trigger: 'blur' }
           ],
           studentAddress: [
             { required: true, message: '请输入家庭住址', trigger: 'blur' }
           ],
           studentEducation: [
             { required: true, message: '请输入学生学历', trigger: 'blur' }
           ],
           studentPhone: [
             { required: true, message: '请输入联系方式', trigger: 'blur' }
           ],
           studentSecondMoney: [
             { required: true, message: '请输入缴费金额', trigger: 'blur' }
           ],
         }
        }
      },

      methods: {
          studentList(params) {
              StudentmanageFy(params).then(res =>{
                this.tableData =  res.resData,
                this.total = res.resData.total,
                this.pageSize = res.resData.pageSize,
                console.log(res.resData.list)

              })
          },
          /**
           * 分页
           */
           handleSizeChange(val) {
             console.log(`每页 ${val} 条`);
          },
          handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
            let params = {pageIndex:val};
            this.studentList(params)
            // StudentmanageFy(params).then(res =>{
            //   this.tableData =  res.resData.list,
            //   this.total = res.resData.total,
            //   this.size = res.resData.size,
            //   console.log(res.resData.list)
            // })
          },

          /**
           * 模糊查询
           */
          changeModel(){
            if(this.studentForm.select == 1){
              this.studentForm.studentId = this.studentForm.studentInfo;
              this.studentForm.studentName = '';
            }else{
              this.studentForm.studentName = this.studentForm.studentInfo;
              this.studentForm.studentId = '';
            }
            console.log(this.studentForm.select);
          },
          submitForm(formName){
            this.$refs[formName].validate((valid) => {
              if (valid) {
                let params = {studentId:this.studentForm.studentId,studentName:this.studentForm.studentName,pageIndex:1};
                StudentmanageFy(params).then(res =>{
                  console.log(res.resData);
                  console.log(this.studentForm.studentInfo);
                  this.tableData = res.resData,
                  this.total = res.resData.total,
                  this.pageSize = res.resData.pageSize
                });
              } else {
                console.log('error submit!!');
                return false;
              }
            });
          },
          /**
           * 删除学生信息
           */
           StudentDel(studentId){
             let param ={studentId:studentId};
             this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning'
             }).then(() => {
             StudentmanageDel(param).then(res =>{
               console.log(studentId);
               if (res.status == 200) {
                     this.$message({
                       message: res.message,
                       type: 'success'
                     });
                   }
             });
             let params = {pageIndex:this.pageIndex};
             this.studentList(params)
           }).catch(() => {
             this.$message({
               type: 'info',
               message: '已取消删除'
             });
          });
           },

           /**
            * 查看详情
            */
           showDetail(val,bool) {
             majormanageAll().then(res =>{
               this.majorAll = res.resData;
               console.log(this.majorAll);
             });
             let params = {studentId:val};
             StudentmanageSel(params).then(res =>{
               if(bool ==1){
                 this.dialogFormVisible=true;
                 console.log(res.resData);
                 this.gridData = res.resData;
                 this.gridData.isShow = true;
               } else {
                 this.dialogFormVisible1=true;
                 console.log(res.resData);
                 this.gridUpData = res.resData;
                 this.gridUpData.isShow = false;
               }
                 // console.log(res.resData);
                 // this.gridData = res.resData;
                 // this.gridData.isShow = bool;
             })
           },



           addDetail(bool) {
             majormanageAll().then(res =>{
               this.majorAll = res.resData;
               console.log(this.majorAll);
             });
            this.dialogFormVisiblee=true;
            this.gridAddData.isShow = bool;

           },

           /**
            * 修改
            */
           submitFormUp(formName) {
            this.$refs[formName].validate((valid) => {
              if (valid) {
                //alert('submit!');
                let user = JSON.parse(window.localStorage.getItem("admin-user"));
                let birth = formatDate(new Date(this.gridUpData.studentBirth),"yyyy/MM/dd");
                let params ={
                  studentName:this.gridUpData.studentName,studentEmail:this.gridUpData.studentEmail,studentSex:this.gridUpData.studentSex,
                  studentNation:this.gridUpData.studentNation,studentId:this.gridUpData.studentId,
                  studentIdcard:this.gridUpData.studentIdcard,studentGraduate:this.gridUpData.studentGraduate,
                  studentBirth:birth,studentAddress:this.gridUpData.studentAddress,
                  studentEducation:this.gridUpData.studentEducation,studentPhone:this.gridUpData.studentPhone,
                  majorId:this.gridUpData.majorId,studentSecondMoney:this.gridUpData.studentSecondMoney,studentModifyPerson:user.teacherRealname
                };

                StudentmanageUp(params).then(res =>{
                  if(res.status == '200'){
                    this.$message({
                      message: res.message,
                      type: 'success',
                    });
                    console.log(this.gridUpData);
                    console.log(this.gridUpData.majorId);
                  }
                });
                this.dialogFormVisible1= false;
                let param = {pageIndex:this.pageIndex};
                this.studentList(param)
              } else {
                console.log('error submit!!');
                return false;
              }
            });
          },
           /**
            * 添加
            */
           submitFormAdd(formName) {
             this.$refs[formName].validate((valid) => {
               if (valid) {
                 //alert('submit!');
                 let user = JSON.parse(window.localStorage.getItem("admin-user"));
                 let birth = formatDate(new Date(this.gridAddData.studentBirth),"yyyy/MM/dd");
                 let params ={
                   studentName:this.gridAddData.studentName,studentEmail:this.gridAddData.studentEmail,studentSex:this.gridAddData.studentSex,studentNation:this.gridAddData.studentNation,
                   studentIdcard:this.gridAddData.studentIdcard,studentGraduate:this.gridAddData.studentGraduate,
                   studentBirth:birth,studentAddress:this.gridAddData.studentAddress,
                   studentEducation:this.gridAddData.studentEducation,studentPhone:this.gridAddData.studentPhone,
                   majorId:this.gridAddData.majorId,studentSecondMoney:this.gridAddData.studentSecondMoney,studentPhoto:this.gridAddData.studentPhoto,studentModifyPerson:user.teacherRealname
                 };
                 StudentmanageAdd(params).then(res =>{
                   if(res.status == '200'){
                     this.$message({
                       message: res.message,
                       type: 'success',
                     });
                     console.log(this.gridAddData);
                     console.log(this.gridAddData.majorId);
                   }
                 });
                 this.dialogFormVisiblee= false;
                 let param = {pageIndex:this.pageIndex};
                 this.studentList(param)
               } else {
                 console.log('error submit!!');
                 return false;
               }
             });
             this.resetForm(formName);
           },
           resetForm(formName) {
             this.$refs[formName].resetFields();
             this.imageUrl = '';
           },

           //上传

           handleAvatarSuccess(res, file) {
             console.log(res.resData);
            // this.imageUrl = res.resData;
            this.imageUrl = URL.createObjectURL(file.raw);
            this.gridAddData.studentPhoto = res.resData;
          },
          handleRemove(file) {
            console.log(file);
          },

          beforeAvatarUpload(file) {
            const isJPG = file.type === 'image/jpeg';
            const isLt2M = file.size / 1024 / 1024 < 2;

            if (!isJPG) {
              this.$message.error('上传头像图片只能是 JPG 格式!');
            }
            if (!isLt2M) {
              this.$message.error('上传头像图片大小不能超过 2MB!');
            }
            return isJPG && isLt2M;
          },

          toggleSelection(rows) {
            if (rows) {
              rows.forEach(row => {
                this.$refs.multipleTable.toggleRowSelection(row);
              });
            } else {
              this.$refs.multipleTable.clearSelection();
            }
          },
          handleSelectionChange(val) {
            this.multipleSelection = val;
          }
      },
      mounted(){
        let params = {pageIndex:this.pageIndex};
        this.studentList(params)
      }
    }
  </script>
